/**
 * Created by baidm in 2022/6/4 on 18:53
 */
import {ref} from "vue";
import {useRouter} from "vue-router";
import {menu} from "@/type/demo.type.ts"
import {openWindow} from "@/hooks/common/useCommon.hook.ts"
import g6DemoConst from "@/const/g6DemoConst.ts"

export default function () {
    const router = useRouter()

    const demoList = ref<menu []>([
        {name: "dagre流程图", id: g6DemoConst.GRAPH_DAGRE}
    ])

    const toggleDemo = (menu: menu) => {
        switch (menu.id) {
            case g6DemoConst.GRAPH_DAGRE:
                openWindow(router, "g6Dagre")
                break;
        }
    }

    return {
        demoList, toggleDemo
    }
}
